<!--
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>个人信息</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0">
    <tr>
        <td>id</td>
        <td>age</td>
        <td>name</td>
    </tr>
    <tr th:each="person:${list}">
        <td th:text="${person.getId()}"></td>
        <td th:text="${person.age}"></td>
        <td th:text="${person.name}"></td>
    </tr>
</table>
</body>
</html>-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- 引入ElementUI组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
    <template>
        <el-alert
                title="成功提示的文案"
                type="success"
                effect="dark">
        </el-alert>
    </template>
    <button @click="getStudents">演示</button>
    <table border="1" cellpadding="0">
        <tr>
            <td>idm</td>
            <td>age</td>
            <td>name</td>
        </tr>
        <tr v-for="student in msg">
            <td>{{student.id}}</td>
            <td>{{student.age}}</td>
            <td>{{student.name}}</td>
        </tr>
    </table>
</div>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            msg: null
        },
        methods:{
            getStudents: function () {
                var that = this;
                axios.get("http://localhost:8086/getAllPerson")
                    .then(function (response) {
                        that.msg = response.data;
                    }).catch(function (reason) {
                    alert("error");
                });
            }
        }
    });
</script>
</body>
</html>
